import type { User } from "@/types/user";
import { defineStore } from "pinia";
import { ref } from "vue";

export const useUserStore = defineStore("cp-user",()=>{
  const userInfo = ref<User>()
  const setUser = (user:User) =>{
    userInfo.value = user
  }
  const clearUser = () =>{
    userInfo.value = undefined
  }
  return{
    userInfo,
    setUser,
    clearUser
  }
},
{
  persist:true
}
)